﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hover.Domain
{
    public class Gender
    {
        public virtual int Id { get; set; }
        public virtual string Sex { get; set; }
    }
    public class Person
    {
        public virtual int Id { get; set; }
        public virtual string FirstName { get; set; }
        public virtual string LastName { get; set; }
        public virtual Gender Gender { get; set; }
        public virtual DateTime Birthday { get; set; }

        public virtual int Age
        {
            get
            {
                DateTime today = DateTime.Now;
                int age = today.Year - Birthday.Year;
                if (today < Birthday.AddYears(age))
                {
                    age--;
                }
                return age;
            }
        }

    }
}
